myApp.config(['$httpProvider', function($httpProvider) {
	delete $httpProvider.defaults.headers.common["X-Requested-With"]; 
}]);

myApp.controller('mainController', function($scope, $http) {
	var url = ctx + '/zk';
	$scope.olderThan = 0;

	$scope.getMyFeed = function(){
		console.log($scope.accessToken);
	  	$http.jsonp(url + '?callback=JSON_CALLBACK&accessToken='+$scope.accessToken+'&olderThan='+$scope.olderThan).success(function(data){
	  		console.log(data.messages);
	  		console.log(data.messages.length);
	  		console.log(data.messages[data.messages.length-1]);
	  		$scope.result = data.messages;

	  		var olderThan = data.messages[data.messages.length-1].id;
	  		$scope.olderThan = olderThan;
	  	});
	};

	$scope.setAccessToken = function(accessToken){
	  	$scope.accessToken = accessToken;
	};

	$scope.nextPage = function(){
		
	}
	
});

